package org.jeecg.modules.basic.print.service.impl;

import org.jeecg.modules.basic.print.entity.DocumentTypeStatusQuery;
import org.jeecg.modules.basic.print.entity.WmsDocumentTypeStatus;
import org.jeecg.modules.basic.print.mapper.WmsDocumentTypeStatusMapper;
import org.jeecg.modules.basic.print.service.IWmsDocumentTypeStatusService;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: 状态配置
 * @Author: jeecg-boot
 * @Date:   2023-09-13
 * @Version: V1.0
 */
@Service
public class WmsDocumentTypeStatusServiceImpl extends ServiceImpl<WmsDocumentTypeStatusMapper, WmsDocumentTypeStatus> implements IWmsDocumentTypeStatusService {
	
	@Autowired
	private WmsDocumentTypeStatusMapper wmsDocumentTypeStatusMapper;
	
	@Override
	public List<WmsDocumentTypeStatus> selectByMainId(String mainId) {
		return wmsDocumentTypeStatusMapper.selectByMainId(mainId);
	}

	@Override
	public WmsDocumentTypeStatus getCodeByStatus(DocumentTypeStatusQuery query) {
		WmsDocumentTypeStatus codeByStatus = wmsDocumentTypeStatusMapper.getCodeByStatus(query);
		if (codeByStatus == null){
			throw new RuntimeException("内容："+query.toString()+"未找到对应流程");
		}
		return codeByStatus;
	}
}
